class Thumbnail:
    def __init__(self, mode):
        self.mode = mode
        self.shape = None
        self.images = []

    def cols(self):
        return 4

    def rows(self):
        return 3

    def percentages(self):
        return [8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96]

    def countModes(self):
        return 8

    def modeName(self, index):
        return f"Mode {index}"

    def add_image(self, image):
        if image is not None:
            self.images.append(image)
            if self.shape is None:
                self.shape = image.shape

    def get_image(self, index):
        if 0 <= index < len(self.images):
            return self.images[index]
        return None

    def get_all_images(self):
        return self.images